var express = require('express');
var app = express();
// var fs = require('fs');
//  var server = require('https').createServer({
//    key: fs.readFileSync('server.key'),
//    cert: fs.readFileSync('server.crt')
//  }, app);
var server = require('http').createServer(app);
var path = require("path");
server.listen(3000, function() {
  console.log('Server listening at 3000')
});

var rtc = require('./rtc')

io = require('socket.io').listen(server);

io.sockets.on('connection', function(socket) {
  rtc.init(socket);
});

app.use(express.static(path.join(__dirname, 'public')));

// app.get('/', function(req, res) {
//   res.sendfile(__dirname + '/public/index.html');
// });
